package com.imooc.framework.controller;

import com.imooc.framework.service.TestServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/api/test")
@Api(description = "服务器向客户端推送消息接口", tags = "Test")
public class TestController {

    @Autowired
    private TestServiceImpl testServiceImpl;
    /**
     * 启动页面
     * @return
     */
    @GetMapping("/start")
    public String start(){
        return "index";
    }

    @GetMapping("/pushToWeb")
    @ApiOperation(value = "服务器端向客户端推送消息", notes = "服务器端向客户端推送消息")
    public String pushToWeb(@RequestBody @ApiParam(value = "回收人编码和医院编码", required = true) String info){

        testServiceImpl.printTime();
        return "123456";
    }

}
